using System.Reflection.Emit;

namespace TSharp.Core.Emit
{
    /// <summary>
    /// SwitchState
    /// </summary>
    internal class SwitchState
    {
        /// <summary>
        /// The default label
        /// </summary>
        private readonly Label defaultLabel;
        /// <summary>
        /// The end switch label
        /// </summary>
        private readonly Label endSwitchLabel;

        /// <summary>
        /// Initializes a new instance of the <see cref="SwitchState"/> class.
        /// </summary>
        /// <param name="defaultLabel">The default label.</param>
        /// <param name="endSwitchLabel">The end switch label.</param>
        public SwitchState(Label defaultLabel, Label endSwitchLabel)
        {
            this.defaultLabel = defaultLabel;
            this.endSwitchLabel = endSwitchLabel;
            DefaultDefined = false;
        }

        /// <summary>
        /// Gets or sets a value indicating whether [default defined].
        /// </summary>
        /// <value><c>true</c> if [default defined]; otherwise, <c>false</c>.</value>
        public bool DefaultDefined { get; set; }

        /// <summary>
        /// Gets the default label.
        /// </summary>
        /// <value>The default label.</value>
        public Label DefaultLabel
        {
            get { return defaultLabel; }
        }

        /// <summary>
        /// Gets the end switch label.
        /// </summary>
        /// <value>The end switch label.</value>
        public Label EndSwitchLabel
        {
            get { return endSwitchLabel; }
        }
    }
}